import java.util.HashMap;
import java.util.Map;

class NucleotideCounter {

    private Map<Character, Integer> dna;

    {
        dna = new HashMap<>() {
        };
        dna.put('A', 0);
        dna.put('C', 0);
        dna.put('G', 0);
        dna.put('T', 0);
    }

    NucleotideCounter(final String inputString) {
        if (!inputString.equals("")) {
            char[] inputChars = inputString.toCharArray();
            for (char c : inputChars) {
                this.dna.put(c, this.dna.getOrDefault(c, 0) + 1);
            }
        }
    }

    Integer count(final Character inputChar) {
        if (!this.dna.containsKey(inputChar)) throw new IllegalArgumentException();

        return this.dna.get(inputChar);
    }

    Map<Character, Integer> nucleotideCounts() {
        return this.dna;
    }
}